from fastapi import FastAPI
from .api import users, chat, knowledge


def create_app() -> FastAPI:
    """
    应用程序初始化逻辑
    :return: app
    """
    app = FastAPI(title="RAG REST API", summary="RAG REST API DOC")
    # 导入其他模块内容
    app.include_router(router=users.router)
    app.include_router(router=chat.router)
    app.include_router(router=knowledge.router)

    # 连接database、redis
    return app
